home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Snippets / PNL Libraries / Libraries / RegExp / regexp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-12  |  959 b   |  33 lines  |  [TEXT/CWIE]

  1. /*
  2.  * Definitions etc. for regexp(3) routines.
  3.  *
  4.  * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
  5.  * not the System V one.
  6.  */
  7.  
  8. #define NSUBEXP  10
  9. typedef struct regexp {
  10.     char *startp[NSUBEXP];
  11.     char *endp[NSUBEXP];
  12.     long regstart;        /* Internal use only. */
  13.     long reganch;        /* Internal use only. */
  14.     char *regmust;        /* Internal use only. */
  15.     long regmlen;        /* Internal use only. */
  16.     char program[1];    /* Unwarranted chumminess with compiler. */
  17. } regexp;
  18.  
  19.  
  20. /*
  21.  * The first byte of the regexp internal "program" is actually this magic
  22.  * number; the start node begins in the second byte.
  23.  */
  24. #define    MAGIC    0234
  25.  
  26. extern pascal regexp *regcomp(char *exp, long excompat);
  27. extern pascal void regfree(regexp *prog);
  28. extern pascal long regexec(register regexp *prog, register char  *string);
  29. extern pascal char *regsub(regexp *prog, char *source, char *dest, long n);
  30.  
  31. /* you have to define this! */
  32. extern void pascal regerror(char *msg);
  33.